package app.goods.info.utils;

import java.util.ArrayList;
import java.util.List;

import app.goods.info.constants.GlobalCache;
import app.goods.info.services.ShopGoodsService;
import app.goods.info.services.domain.GoodsInfo;
import app.goods.info.services.domain.ShopGoodsInfo;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

public class MockData {
	public static List<GoodsInfo> mockShopGoods() {
		List<GoodsInfo> shopGoodsInfos = new ArrayList<GoodsInfo>();
		String jsonString = FileReaderUtils.readFileQuikly("configs/AllCentralizedGoods.json");
		JSONArray allGoods = JSONUtil.parseArray(jsonString);
		shopGoodsInfos = JSONUtil.toList(allGoods, GoodsInfo.class);
		return shopGoodsInfos;
	}

	public static void main(String[] args) {
		GlobalCache.getInstance().initAllCache();
		FileReaderUtils.writeAllGoodsIntoOneExcel(MockData.mockShopGoods());
		javax.naming.Context c;
	}
}
